package com.goodmean.common.routes;

import com.goodmean.common.interceptor.ProjectInterceptor;
import com.goodmean.student.StudentController;
import com.goodmean.teacher.admin.AdminController;
import com.goodmean.teacher.instructor.InstructorController;
import com.goodmean.teacher.teacher.TeacherController;
import com.jfinal.config.Routes;

/**
 * Routes级别拦截器
 * 未登陆访问其他页面时将跳转到登陆页面
 * AdminAuthInterceptor  将拦截
 * TeacherController、InstructorController、AdminController、StudentController
 * 中所有的 action 方法。
 **/
public class ProjectRoutes extends Routes {
    @Override
    public void config() {
        setBaseViewPath("/WEB-INF/pages");
        //以下路径拦截器
        addInterceptor(new ProjectInterceptor());
        //教师模块路由
        add("teacher", TeacherController.class, "/teacher");
        //辅导员模块路由
        add("instructor", InstructorController.class, "/instructor");
        //管理员模块路由
        add("admin", AdminController.class, "/admin");
        //学生模块路由
        add("student", StudentController.class, "/student");
    }
}
